//
//  ItemSecondAnotherTopView.m
//  Lovelife
//
//  Created by apple on 15/4/28.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "ItemSecondAnotherTopView.h"
#import "NightManager.h"

@implementation ItemSecondAnotherTopView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        
        self.Img = [[UIImageView alloc]init];
        
        [self addSubview:self.Img];
        
        [_Img release];
        
        self.titleTop = [[BaseLabel alloc]init];
        
        [self addSubview:self.titleTop];
        
        [_titleTop release];
        
        self.jianjieTop = [[BaseLabel alloc]init];
        
        [self addSubview:self.jianjieTop];
    
        
        [_jianjieTop release];
        
        self.title = [[BaseLabel alloc]init];
        
        [self addSubview:self.title];
        
        [_title release];
        
        self.jianjie = [[BaseLabel alloc]init];
        
        [self addSubview:self.jianjie];
        
        [_jianjie release];
        
        
    }
    return self;


}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.Img.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height/3);
    self.Img.backgroundColor = [UIColor yellowColor];

    
    self.titleTop.frame = CGRectMake(0, self.frame.size.height/3 - 30, self.frame.size.width, 30);
    

    
    [_titleTop release];
    
    self.jianjieTop.frame = CGRectMake(5, self.frame.size.height/3+10, self.frame.size.width-5, self.frame.size.height/2);

    
    self.jianjieTop.font = [UIFont systemFontOfSize:14];
    
    self.jianjieTop.numberOfLines = 0 ;
    
    
    [self.jianjieTop sizeToFit];
    
    self.jianjieTop.lineBreakMode = NSLineBreakByTruncatingMiddle;
    

    
    self.title.frame = CGRectMake(5, self.frame.size.height/3*2 +20, self.frame.size.width, 25);
 ;
    
    self.jianjie.frame = CGRectMake(5, self.frame.size.height/3*2 +60, self.frame.size.width - 5, self.frame.size.height/3);
    
    self.jianjie.font = [UIFont systemFontOfSize:13];
    [self.jianjie sizeToFit];
    
    self.jianjie.lineBreakMode = NSLineBreakByTruncatingMiddle;
   
}

-(void)setNightDayModel
{
    [NightManager setBackgroundColorWithCollectionView:self];
    
    [NightManager setLabelColorWithLabel:self.title];
    
    [NightManager setLabelColorWithLabel:self.jianjie];
    
    [NightManager setLabelColorWithLabel:self.titleTop];
    
    [NightManager setLabelColorWithLabel:self.jianjieTop];
}

-(void)setLightDayModel
{
    [NightManager setBackgroundColorWithCollectionView:self];
    
    [NightManager setLabelColorWithLabel:self.titleTop];
    
    [NightManager setLabelColorWithLabel:self.jianjieTop];
    
    [NightManager setLabelColorWithLabel:self.title];
    
    [NightManager setLabelColorWithLabel:self.jianjie];
    
}
@end
